package com.lrkj.workorder.domain;

import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.lrkj.common.annotation.Excel;
import com.lrkj.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;

/**
 * 工单管理对象 tb_work_order
 *
 * @author yajun_ren
 * @date 2022-04-21
 */
@Data
public class WorkOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private String id;

    /** 所属小区 */
    @Excel(name = "所属小区")
    private String communityId;

    /** 所属楼栋 */
    @Excel(name = "所属楼栋")
    private String floorId;

    /** 所属单元 */
    @Excel(name = "所属单元")
    private String unitId;

    /** 所属房屋 */
    @Excel(name = "所属房屋")
    private String roomId;

    /** 单号 */
    @Excel(name = "单号")
    private String no;

    /** 工单类型 */
    @Excel(name = "工单类型")
    private String orderType;

    /** 发起人id */
    @Excel(name = "发起人id")
    private String charterMemberId;

    /** 发起人名称 */
    @Excel(name = "发起人名称")
    private String charterMemberName;

    /** 发起时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "发起时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date charterTime;

    /** 服务区域 */
    @Excel(name = "服务区域")
    private String coverage;

    /** 重要程度 */
    @Excel(name = "重要程度")
    private String degreeImportance;

    /** 所在位置 */
    @Excel(name = "所在位置")
    private String location;

    /** 反映人id */
    @Excel(name = "反映人id")
    private String reflectPeopleId;

    /** 反映人名称 */
    @Excel(name = "反映人名称")
    private String reflectPeople;

    /** 手机号 */
    @Excel(name = "手机号")
    private String phoneNum;

    /** 内容描述 */
    @Excel(name = "内容描述")
    private String content;

    /** 保修项目 */
    @Excel(name = "保修项目")
    private String warrantyProject;

    /** 维修类型 */
    @Excel(name = "维修类型")
    private String repairType;

    /** 投诉类别 */
    @Excel(name = "投诉类别")
    private String complaintType;

    /** 立项判别 */
    @Excel(name = "立项判别")
    private String projectIdentification;

    /** 图片地址 */
    @Excel(name = "图片地址")
    private String imageAddress;

    /** 接单人id */
    @Excel(name = "接单人id")
    private String receivingPersonId;

    /** 接单人名称 */
    @Excel(name = "接单人名称")
    private String receivingPersonName;

    /** 协办人id */
    @Excel(name = "协办人id")
    private String jointlyPersonId;

    /** 协办人名称 */
    @Excel(name = "协办人名称")
    private String jointlyPersonName;

    /** 预约时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date appointmentTime;

    /** 挂单人id */
    @Excel(name = "挂单人id")
    private String suspendPersonId;

    /** 挂单人名称 */
    @Excel(name = "挂单人名称")
    private String suspendPersonName;

    /** 状态 */
    @Excel(name = "状态")
    private String status;

    //工单类型名称
    private String orderTypeName;

    //工单类型代码
    private String orderTypeCode;

    //小区名称
    private String communityName;

    /** 办结人id */
    @Excel(name = "办结人id")
    private String concludePersonId;

    /** 办结人姓名 */
    @Excel(name = "办结人姓名")
    private String concludePersonName;

    /** 办结时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "办结时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date concludePersonTime;


    /** 回访人id */
    @Excel(name = "回访人id")
    private String returnPersonId;

    /** 回访人姓名 */
    @Excel(name = "回访人姓名")
    private String returnPersonName;

    /** 回访时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "回访时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date returnPersonTime;

    /** 是否电话回访 */
    @Excel(name = "是否电话回访")
    private String returnPhone;

    /** 客户是否满意 */
    @Excel(name = "客户是否满意")
    private String returnSatisfaction;

    /** 投诉内容 */
    @Excel(name = "投诉内容")
    private String returnContent;

    /** 总工时 */
    @Excel(name = "总工时")
    private String formatBetween;


    /** 转接人id */
    @Excel(name = "转接人id")
    private String carePersonId;

    /** 转接人姓名 */
    @Excel(name = "转接人姓名")
    private String carePersonName;

    /** 转交时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "转交时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date carePersonTime;

    /** 转介原因 */
    @Excel(name = "转介原因")
    private String careReason;


    /** 原接单交人id */
    @Excel(name = "原接单交人id")
    private String careRawPersonId;

    /** 原接单人姓名 */
    @Excel(name = "原接单人姓名")
    private String careRawPersonName;


    /** 退单人id */
    @Excel(name = "退单人id")
    private String chargebackPersonId;

    /** 退单人姓名 */
    @Excel(name = "退单人姓名")
    private String chargebackPersonName;

    /** 退单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "退单时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date chargebackTime;

    /** 退单原因 */
    @Excel(name = "退单原因")
    private String chargebackContent;

    /** 挂单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "挂单时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date suspendPersonTime;

    /** 挂单原因 */
    @Excel(name = "挂单原因")
    private String suspendPersonReason;

    /** 结束挂单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束挂单时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endSuspendTime;

    /** 返修人id */
    @Excel(name = "返修人id")
    private String repairPersonId;

    /** 返修人姓名 */
    @Excel(name = "返修人姓名")
    private String repairPersonName;

    /** 返修时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "返修时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date repairPersonTime;

    /** 返修原因 */
    @Excel(name = "返修原因")
    private String repairContent;

    /** 客户id */
    @Excel(name = "客户id")
    private String customId;


    /** 退单原因 */
    @Excel(name = "退单原因")
    private String retreatContent;


    private List<WorkOrderLog> logList;

    private Integer counts;

    /** 工单来源 */
    @Excel(name = "工单来源")
    private String wordType;


    //根据内容或者工单号查询
    private String contentOrNo;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("communityId", getCommunityId())
            .append("floorId", getFloorId())
            .append("unitId", getUnitId())
            .append("roomId", getRoomId())
            .append("no", getNo())
            .append("orderType", getOrderType())
            .append("charterMemberId", getCharterMemberId())
            .append("charterMemberName", getCharterMemberName())
            .append("charterTime", getCharterTime())
            .append("coverage", getCoverage())
            .append("degreeImportance", getDegreeImportance())
            .append("location", getLocation())
            .append("reflectPeopleId", getReflectPeopleId())
            .append("reflectPeople", getReflectPeople())
            .append("phoneNum", getPhoneNum())
            .append("content", getContent())
            .append("warrantyProject", getWarrantyProject())
            .append("repairType", getRepairType())
            .append("complaintType", getComplaintType())
            .append("projectIdentification", getProjectIdentification())
            .append("imageAddress", getImageAddress())
            .append("receivingPersonId", getReceivingPersonId())
            .append("receivingPersonName", getReceivingPersonName())
            .append("jointlyPersonId", getJointlyPersonId())
            .append("jointlyPersonName", getJointlyPersonName())
            .append("appointmentTime", getAppointmentTime())
            .append("suspendPersonId", getSuspendPersonId())
            .append("suspendPersonName", getSuspendPersonName())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
